﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Kokomo.Mirror
{
	public static class BinaryReaderExtensions
	{
		public static string ReadNullTerminatedString(this BinaryReader reader)
		{
			StringBuilder builder = new StringBuilder();
			for (char c = reader.ReadChar(); c != '\0'; c = reader.ReadChar())
			{
				builder.Append(c);
			}
			string str = builder.ToString();

			return str;
		}
		public static string ReadFixedLengthString(this BinaryReader reader, int length)
		{
			return new string(reader.ReadChars(length));
		}
	}
}
